<?php

class Com_note extends Acan{
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
		$this->model = Afun_db()->model(Acan_table_note);
	}
	//搜索
	function search($limit='3'){
		$search = $this->id;
		$con->where = "a.if_auth=1 ";
		if($search){
			$con->where .= "and (a.`title` LIKE '%$search%' or a.`note` LIKE '%$search%') ";
		}
		$page->page = $limit;
		$page->order = "time_up DESC";
		return Afun_new('data',Acan_table_note)->datas($con,$page);
	}
	//显示一篇文章
	function show(){
		$this->model->clickPk('click',$this->id);//计数
		return $this->model->ofindPk($this->id);
	}


}
?>